import { Injectable } from '@angular/core';
type Product = {
  name: String;
  price: Number;
  number: Number;
};
@Injectable({
  providedIn: 'root',
})
export class CartService {
  items: Product[] = [{ name: 'a', price: 12, number: 12 }];
  addToCart(product: Product) {
    this.items.push(product);
  }

  getItems() {
    return this.items;
  }

  clearCart() {
    this.items = [];
    return this.items;
  }
  constructor() {}
}
